package com.niuwa.p2p.service.impl.debtMatching;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.niuwa.p2p.core.mvc.entity.PageBean;
import com.niuwa.p2p.dao.claimtransfer.TransferApplyDao;
import com.niuwa.p2p.entity.PageQuery;
import com.niuwa.p2p.entity.claimtransfer.TransferApply;
import com.niuwa.p2p.service.debtMatching.ISelfDebtTransferService;

/**
 * 协议接口
 * @author lijian
 */
@Service
public class SelfDebtTransferServiceImpl implements ISelfDebtTransferService {
	
	@Autowired
	private TransferApplyDao  transferApplyDao;

	
	/**
	 * 
	 * 分页查询
	 * paramMap 查询参数
	 */
	
	public PageBean<TransferApply> searchSelfDebtTransfer(Map<String, Object> paramMap){
		assert paramMap.get(PageQuery.PAGEQUERY) != null;
		//总条数
		int totalCount = transferApplyDao.searchSelfDebtTransferCountByCondition(paramMap);
		PageBean<TransferApply> page = new PageBean<TransferApply>(totalCount);
		// 当前页
		page.setPage(((PageQuery) paramMap.get(PageQuery.PAGEQUERY)).getPage());
		page.setRows(transferApplyDao.searchSelfDebtTransferByCondition(paramMap));
		return page;
	}


	public TransferApplyDao getTransferApplyDao() {
		return transferApplyDao;
	}


	public void setTransferApplyDao(TransferApplyDao transferApplyDao) {
		this.transferApplyDao = transferApplyDao;
	}


}
